import Vue from 'vue'
import VueRouter from 'vue-router'
import life from './liferouter/LifeRouter'
import index from './index/index'
import CreditCar from './CreditCar/CreditCar.js'
import money from './money/money.js'

Vue.use(VueRouter)

const routes = [
  ...money,
  ...CreditCar,

  ...index,
  // {
  //   path: '/index',
  //   name: 'index',
  //   component: () => import('@/views/IndexCom.vue')
  // },
  {
    path: '/car',
    name: 'car',
    component: () => import('@/views/CreditCar.vue')
  },
  // {
  //   path: '/money',
  //   name: 'money',
  //   component: () => import('@/views/MoneyCom.vue')
  // },


  // es6扩展运算符
  ...life,
  // {
  //   path: '/life',
  //   name: 'life',
  //   component: () => import('@/views/LifeCom.vue')
  // },

  {
    path: '/my',
    name: 'my',
    component: () => import('@/views/MyCom.vue'),
    children:[
      
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/LoginCom.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/RegisterCom.vue')
  },
  // 一键绑卡页面
  {
    path: '/bing',
    name: 'bing',
    component: () => import('@/views/MyCom/BinDing.vue')
  },
  // 实名认证页面
  {
    path: '/auton',
    name: 'auton',
    component: () => import('@/views/MyCom/AutonYm.vue')
  },
  // 安全中心页面
  {
    path: '/safety',
    name: 'safety',
    component: () => import('@/views/MyCom/SaFety.vue')
  },
  // 地址管理页面
  {
    path: '/site',
    name: 'site',
    component: () => import('@/views/MyCom/SiTe.vue')
  },
  // 获取卡号页面
  {
    path: '/applyfor',
    name: 'applyfor',
    component: () => import('@/views/MyCom/ApplyFor.vue')
  },
  // 绑定设备页面
  {
    path: '/bang',
    name: 'bang',
    component: () => import('@/views/MyCom/BangDing.vue')
  },
  // 发现页面
  {
    path: '/faxian',
    name: 'faxian',
    component: () => import('@/views/MyCom/FaXian.vue')
  },
  // 快捷支付管理页面
  {
    path: '/kuaijie',
    name: 'kuaijie',
    component: () => import('@/views/MyCom/KuaiJie.vue')
  },
  {
    path: '/',
    redirect: '/index',
  },
  {
    path:'/search',
    name:'search',
    component:()=> import('@/views/SearchCom.vue')
  },
  // {
  //   path: '*',
  //   component: () => import('../views/NotFound.vue')
  // }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})




export default router
